#include "serverCal.hpp"
#include "tcpServer.hpp"

static void Usage(const std::string &proc)
{
    std::cout << "\nUsage: " << proc << " port\n" << std::endl; 
}

int main(int arg, char* args[]){
    if(arg != 2){
        Usage(args[0]);
        exit(0);
    }
    uint16_t port = std::stoi(args[1]);
    serverCal ser;
    tcpServer *tcp = new tcpServer(port, std::bind(&serverCal::calculator, &ser, std::placeholders::_1));

    tcp->init();

    // daemon(0, 0);

    tcp->start();

    return 0;
}